package com.campus.service.impl;

import com.campus.dao.TeachingCallingDetailDao;
import com.campus.dto.TeachingCallingDetail;
import com.campus.service.TeachingCallingDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class TeachingCallingDetailServiceImpl implements TeachingCallingDetailService {
    @Autowired
    private TeachingCallingDetailDao teachingCallingDetailDao;

    @Override
    public boolean addCallingDetail(TeachingCallingDetail detail) {
        return teachingCallingDetailDao.addCallingDetail(detail) > 0;
    }

    @Override
    public boolean deleteCallingDetailById(int id) {
        return teachingCallingDetailDao.deleteCallingDetailById(id) > 0;
    }

    @Override
    public boolean updateCallingDetail(TeachingCallingDetail detail) {
        return teachingCallingDetailDao.updateCallingDetail(detail) > 0;
    }

    @Override
    public List<TeachingCallingDetail> getAllCallingDetails() {
        return teachingCallingDetailDao.findAllCallingDetails();
    }
}
